import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/emergency_res_nearby_entity.dart';

EmergencyResNearbyEntity $EmergencyResNearbyEntityFromJson(Map<String, dynamic> json) {
  final EmergencyResNearbyEntity emergencyResNearbyEntity = EmergencyResNearbyEntity();
  final String? address = jsonConvert.convert<String>(json['address']);
  if (address != null) {
    emergencyResNearbyEntity.address = address;
  }
  final String? attachmentAddress = jsonConvert.convert<String>(json['attachmentAddress']);
  if (attachmentAddress != null) {
    emergencyResNearbyEntity.attachmentAddress = attachmentAddress;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    emergencyResNearbyEntity.companyCode = companyCode;
  }
  final String? contactInformation = jsonConvert.convert<String>(json['contactInformation']);
  if (contactInformation != null) {
    emergencyResNearbyEntity.contactInformation = contactInformation;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    emergencyResNearbyEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    emergencyResNearbyEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    emergencyResNearbyEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    emergencyResNearbyEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    emergencyResNearbyEntity.id = id;
  }
  final String? institutionType = jsonConvert.convert<String>(json['institutionType']);
  if (institutionType != null) {
    emergencyResNearbyEntity.institutionType = institutionType;
  }
  final String? institutionTypeName = jsonConvert.convert<String>(json['institutionTypeName']);
  if (institutionTypeName != null) {
    emergencyResNearbyEntity.institutionTypeName = institutionTypeName;
  }
  final String? photosOfShelters = jsonConvert.convert<String>(json['photosOfShelters']);
  if (photosOfShelters != null) {
    emergencyResNearbyEntity.photosOfShelters = photosOfShelters;
  }
  final String? remarks = jsonConvert.convert<String>(json['remarks']);
  if (remarks != null) {
    emergencyResNearbyEntity.remarks = remarks;
  }
  final String? resourceOrganizationName = jsonConvert.convert<String>(json['resourceOrganizationName']);
  if (resourceOrganizationName != null) {
    emergencyResNearbyEntity.resourceOrganizationName = resourceOrganizationName;
  }
  final String? responsiblePerson = jsonConvert.convert<String>(json['responsiblePerson']);
  if (responsiblePerson != null) {
    emergencyResNearbyEntity.responsiblePerson = responsiblePerson;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    emergencyResNearbyEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    emergencyResNearbyEntity.updateById = updateById;
  }
  final String? estimateName = jsonConvert.convert<String>(json['estimateName']);
  if (estimateName != null) {
    emergencyResNearbyEntity.estimateName = estimateName;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    emergencyResNearbyEntity.updateDate = updateDate;
  }
  return emergencyResNearbyEntity;
}

Map<String, dynamic> $EmergencyResNearbyEntityToJson(EmergencyResNearbyEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['address'] = entity.address;
  data['attachmentAddress'] = entity.attachmentAddress;
  data['companyCode'] = entity.companyCode;
  data['contactInformation'] = entity.contactInformation;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['institutionType'] = entity.institutionType;
  data['institutionTypeName'] = entity.institutionTypeName;
  data['photosOfShelters'] = entity.photosOfShelters;
  data['remarks'] = entity.remarks;
  data['resourceOrganizationName'] = entity.resourceOrganizationName;
  data['responsiblePerson'] = entity.responsiblePerson;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['estimateName'] = entity.estimateName;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension EmergencyResNearbyEntityExtension on EmergencyResNearbyEntity {
  EmergencyResNearbyEntity copyWith({
    String? address,
    String? attachmentAddress,
    String? companyCode,
    String? contactInformation,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    String? institutionType,
    String? institutionTypeName,
    String? photosOfShelters,
    String? remarks,
    String? resourceOrganizationName,
    String? responsiblePerson,
    String? updateBy,
    String? updateById,
    String? estimateName,
    String? updateDate,
  }) {
    return EmergencyResNearbyEntity()
      ..address = address ?? this.address
      ..attachmentAddress = attachmentAddress ?? this.attachmentAddress
      ..companyCode = companyCode ?? this.companyCode
      ..contactInformation = contactInformation ?? this.contactInformation
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..institutionType = institutionType ?? this.institutionType
      ..institutionTypeName = institutionTypeName ?? this.institutionTypeName
      ..photosOfShelters = photosOfShelters ?? this.photosOfShelters
      ..remarks = remarks ?? this.remarks
      ..resourceOrganizationName = resourceOrganizationName ?? this.resourceOrganizationName
      ..responsiblePerson = responsiblePerson ?? this.responsiblePerson
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..estimateName = estimateName ?? this.estimateName
      ..updateDate = updateDate ?? this.updateDate;
  }
}
